import request from '@/utils/request'

// 查询图书借阅表列表
export function listLeft(query) {
  return request({
    url: '/book/left/list',
    method: 'get',
    params: query
  })
}

// 查询图书借阅表详细
export function getLeft(id) {
  return request({
    url: '/book/left/' + id,
    method: 'get'
  })
}

// 新增图书借阅表
export function addLeft(data) {
  return request({
    url: '/book/left',
    method: 'post',
    data: data
  })
}

// 修改图书借阅表
export function updateLeft(id) {
  return request({
    url: '/book/left/updateLeftById/' + id,
    method: 'get'
  })
}

// 修改图书借阅表
export function updateReturn(id) {
  return request({
    url: '/book/left/returnLeftById/' + id,
    method: 'get'
  })
}

// 删除图书借阅表
export function delLeft(id) {
  return request({
    url: '/book/left/' + id,
    method: 'delete'
  })
}

// 借阅图书
export function addLeftByBookId(bookId) {
  return request({
    url: '/book/left/addLeftByBookId/' + bookId,
    method: 'get'
  })
}
